package com.cykj.service.impl;

import com.cykj.dto.ResponseDTO;
import com.cykj.mapper.CyGoodMapper;
import com.cykj.service.ICyGoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CyGoodServiceImpl implements ICyGoodService {

    @Autowired
    private CyGoodMapper cyGoodMapper;

    @Override
    public ResponseDTO updateGoodStock(Integer goodId, Integer count) {
        Integer re = cyGoodMapper.subGoodStock(goodId, count);
        return re > 0 ? ResponseDTO.success("库存更新成功")
                : ResponseDTO.error("库存更新失败");
    }
}
